import jsonp from 'common/js/jsonp'
import {commonParams, options} from './config'
import axios from 'axios'

export function getRecommend() {
  const url = 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg'

  const data = Object.assign({}, commonParams, {
    platform: 'h5',
    uin: 0,
    needNewCode: 1
  })

  return jsonp(url, data, options)
}

export function getTiplists() {
  const url = 'http://easy-mock.com/mock/59775208a1d30433d83d619c/example/dpi/lists'
  return axios.get(url, {
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}
//商品详情接口
export function getDetails(detailId) {
  const url = 'http://easy-mock.com/mock/59775208a1d30433d83d619c/example/dpi/getail'
  return axios.get(url, {
    detail:detailId
  }).then((res) => {
    return Promise.resolve(res.data)
  })
}